sets.id=[1 2 3];
sets.name={'train'  'val'  'test'};

classes.name = {...
  'aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', ...
  'cat', 'chair', 'cow', 'diningtable', 'dog', 'horse', 'motorbike', ...
  'person', 'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor'} ;

paths.image='../data/voc12/JPEGImages/%s.jpg';
paths.classSegmentation='../data/voc12/SegmentationClass/%s.png';

N=2913;Nv=1449;
images.id=1:N;

files=dir('../data/voc12/SegmentationClass'); 
for i=3:N+2
    tmp=files(i).name;
    images.name(i-2)={tmp(1:end-4)};
end

images.segmentation=ones(1,N);

images.set=ones(1,N);
% rall=randperm(N);rid=rall(1:Nv);
% images.set(rid)=2;
train=importdata('../data/voc12/Segmentation-txt/val.txt');
for i =1: length(train)
    id=find(strcmp(images.name,train{i}));
    images.set(id)=2;
end



% save('imdby.mat','imdb');
save('imdb.mat','sets','classes','paths','images');